package com.itheima.leadnews.feign.wemedia;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.model.wemedia.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("leadnews-wemedia")
public interface WemediaFeign {

    /**
     * 根据ID查询自媒体文章
     * @param id
     * @return
     */
    @GetMapping("/api/v1/news/one/{id}")
    public ResponseResult<WmNews> one(@PathVariable("id") Integer id);

    /**
     * 发布文章
     * @param wmNews
     * @return
     */
    @PutMapping("/wmNews/publish")
    public ResponseResult publish(@RequestBody WmNews wmNews);

    /**
     * 保存app端用户信息
     * @param wmUser
     * @return
     */
    @PostMapping("/apUser/auth/pass")
    public ResponseResult pass(@RequestBody WmUser wmUser);
}
